<?php
/**
 * User: zhangyu
 * Date: 2022/4/28
 * Time: 11:10
 */

declare (strict_types = 1);
namespace app\event;
use app\admin\model\LoginLogModel;

class UserLogin
{
    public function __construct($account, $status, $classify, $msg = "")
    {
        if (env("LOGIN.LOGIN_LOG")) {
            $data = [
                "account" => $account,
                "status" => intval($status),
                "last_login_time" => time(),
                "classify" => intval($classify),
                "content" => !empty($msg) ? $msg : config('apiCode') [$status],
            ];

            LoginLogModel::create($data);
        }
    }
}